<?php
$name = isset($this->name) ? $this->name : 'Category';
$this->headScript()->appendFile(_STATIC_HTTP . '/admin/js/_ajax.js');
?>
<?php $this->headStyle()->captureStart();?>
td.icon a {width:90px;height:55px;}
td.icon a img {width:90px;}
<?php $this->headStyle()->captureEnd();?>
<?php $this->headScript()->captureStart();?>
$(document).ready(function(){
	_ajax.id = $('#special-list');
	_ajax.form = $('form.ajaxForm');
	_ajax.name = 'special';
	_ajax.loading = $('#special-list').html();
	_ajax.url = '<?php echo $this->url('picture/ajax/addSpecialTo' . $name);?>';
	_ajax.load();
});
<?php $this->headScript()->captureEnd();?>
<form action="" method="post" class="ajaxForm">
<?php
echo $this->form()->hidden('referer', $this->referer);
echo $this->form()->hidden('addSpecial', '1') . "\n";
?>
<div class="body">
	<table class="search form">
		<tr>
			<th><?php echo $this->language('Specials');?></th>
			<th style="width:320px;"><?php echo $this->language('Add Special(s) To This ' . $name);?></th>
		</tr>
		<tr>
			<td>
				<div class="search left" style="padding:2px 3px;">	
					<span><?php echo $this->partial('picture/_inc/categorySelect.phtml', array('name' => 'category_id'));?></span>
					<span><?php echo $this->render('include/searchInput.phtml');?></span>
					<span><button type="button" value="Search" onclick="_ajax.load();">Search</button></span>
					<label><?php echo $this->language('SELECT ALL');?><input type="checkbox" id="check-all" onclick="_ajax.checkAll(this);" /></label>
				</div>
				<hr/>
				<div id="special-list" class="center">
					<h1 style="padding:10px;"><?php echo $this->language('Loading')?>...</h1>
				</div>
			</td>
			<td>
				<table class="no-border form">	
					<tr>
						<td class="icon"><a href="<?php echo $this->row->getCover()->getLarge(false);?>" target="_blank"><img src="<?php echo $this->row->getCover()->getThumb(false);?>" /></a></td>
						<td>
							<h3 style="margin-bottom:5px;"><?php echo $this->escape($this->row->getLocale()->getTitle());?></h3>
							<strong>KEY: </strong><span class="red"><?php echo $this->row->getName();?></span>
						</td>
						<td><h1><?php echo $this->row->getLocale()->getStotal();?></h1><code>SPECIAL(s)</code></td>
					</tr>
				</table>
				<hr/>
				<select name="special_id[]" id="special-id-x" style="width:100%;height:320px;" multiple="multiple"><?php 
				foreach($this->specialList AS $special) {
					echo '<option value="' . $special->getId() . '" selected="selected">';
					echo $special->getTitle() . '[' . $special->getName() . '][' . $special->getPtotal() . ']</option>';
				}
				?></select>
				<hr/>
				<button type="submit" name="addSpecialTo<?php echo $name;?>" value="submit"><?php echo $this->language('Continue');?> »</button>
				<button type="button" name="cancel" value="cancel" onclick="history.back();"><?php echo $this->language('Cancel');?> »</button>
			</td>
		</tr>
	</table>
</div>
</form>
